﻿@model Sharp.Web.Models.GroupModel
@using System.Web.UI.WebControls
@using Ext.Net
@using Ext.Net.MVC

@{
    var x = Html.X();
}
@(

 x.Window().Layout(LayoutType.Fit).Title("添加")
            .CloseAction(CloseAction.Destroy)
            .Width(700)
            .Items(
                x.FormPanel().Layout(LayoutType.Column).Default().Items(
                        x.TextFieldFor(f => f.Code).ColumnWidth(.5).Padding(4),
                        x.TextFieldFor(f => f.Title).ColumnWidth(.5).Padding(4),
                            x.DropDownFieldFor(f => f.OrgTitle).OrgList(Model.OrgTree).Editable(false).ColumnWidth(.5).Padding(4).AutoScroll(true).AutoSize(),
                        x.HiddenFor(f=>f.OrgId),
                        x.TextAreaFor(f => f.Remark).ColumnWidth(1).Padding(4)
                )
                    .Buttons(
                            x.Button().Text("提交").Icon(Icon.Disk).Hidden(true)
                            .DirectEvents(de =>
                            {
                                de.Click.Before = "App.Edit.submitReady";
                                de.Click.Action = "Save";
                                de.Click.EventMask.ShowMask = true;
                                de.Click.EventMask.Msg = "正在提交...";
                                de.Click.EventMask.MinDelay = 1000;
                                de.Click.Success = "App.Edit.PostBackSuccess";
                            }),
                            x.Button().Text("关闭").Icon(Icon.Cancel).OnClientClick("App.Edit.CloseWindow(this)")
                    )
            )
)
